//-------------------------------------------------------------------
//  BIGINT.h
//-------------------------------------------------------------------
//-------------------------------------------------------------------
//  big integer
//-------------------------------------------------------------------
void bigint_null(BIGINT* a);
void bigint_copy(BIGINT* a, BIGINT* b);
void field_to_bigint(FIELD2N* a, BIGINT* b);
void bigint_to_field(BIGINT* a, FIELD2N* b);
void bigint_neg(BIGINT* a); // unsigend -> 2's complement
void bigint_add(BIGINT* a, BIGINT* b, BIGINT* c);
void bigint_sub(BIGINT* a, BIGINT* b, BIGINT* c);
void bigint_mul(BIGINT* a, BIGINT* b, BIGINT *c);
void bigint_div(BIGINT* top, BIGINT* bottom, BIGINT* quotient, BIGINT* remainder);
void bigint_div2(BIGINT* x);
void ascii_to_bigint(char* instring, BIGINT* outhex);
void bigint_to_ascii(BIGINT* inhex, char* outstring);
void hex_ascii_to_bigint(char* instring, BIGINT* outhex);
void hex_to_bigint(char* instring, BIGINT* outhex);
void bigint_gcd(BIGINT* u, BIGINT* v, BIGINT* w);
void bigint_swap(BIGINT* u, BIGINT* v);
//-------------------------------------------------------------------
//  modular
//-------------------------------------------------------------------
void bigint_mod_exp(BIGINT* x, BIGINT* n, BIGINT* q, BIGINT* z);
void bigint_mod_add(BIGINT* a, BIGINT* b, BIGINT* c, BIGINT* p);
void bigint_mod_sub(BIGINT* a, BIGINT* b, BIGINT* c, BIGINT* p);
void bigint_mod_mul(BIGINT* a, BIGINT* b, BIGINT* c, BIGINT* p);
void bigint_mod_div(BIGINT* a, BIGINT* b, BIGINT* c, BIGINT* p);
void bigint_mod_inv(BIGINT* a, BIGINT* a_inv, BIGINT* p);
//-------------------------------------------------------------------
//  Montgomery
//-------------------------------------------------------------------
void bigint_mmm(BIGINT* a, BIGINT* b, BIGINT* c, BIGINT* p);
void bigint_mmm_fast(BIGINT* a, BIGINT* b, BIGINT* c, BIGINT* p);
void bigint_mmd(BIGINT* a, BIGINT* b, BIGINT* c, BIGINT* p);
void bigint_to_mon(BIGINT* a, BIGINT* b, BIGINT* p);
void mon_to_bigint(BIGINT* a, BIGINT* b, BIGINT* p);
void gen_big_mon_const(BIGINT* one, BIGINT* mon_const, BIGINT* p);
//-------------------------------------------------------------------
//  print
//-------------------------------------------------------------------
void print_bigint(BIGINT* a);
//-------------------------------------------------------------------
//  stream
//-------------------------------------------------------------------
void wfile_bigint(BIGINT* a, char* filename);
void afiel_bigint(BIGINT* a, char* filename);
void rfile_bigint(BIGINT* a, char* filename);
//-------------------------------------------------------------------
